import { Inject, Provide } from '@midwayjs/core';
import { BaseService } from '../../../common/base.service';
import { BaseSysMenu } from '../entity/menu';
import { InjectDataSource, InjectEntityModel } from '@midwayjs/typeorm';
import { DataSource, Repository } from 'typeorm';
import { RedisService } from '@midwayjs/redis';

@Provide()
export class MenuService extends BaseService<BaseSysMenu> {
  @InjectEntityModel(BaseSysMenu)
  userModel: Repository<BaseSysMenu>;

  @Inject()
  redisService: RedisService;

  @InjectDataSource()
  defaultDataSource: DataSource;

  getModel(): Repository<BaseSysMenu> {
    return this.userModel;
  }
}
